<template>
  <div class="header-back">
    <header class="nav-header">
      <div class="back" @click="goBack">
        <i class="icon"></i>
        <h4 class="title">{{title}}</h4>
      </div>
      <div class="right-wrap">
        <slot name="navHeaderRight"></slot>
      </div>
    </header>
  </div>
</template>

<script>
export default {
  props: {
    // title:{String,default:""}
  },
  computed: {
    title() {
      return this.$store.state.app.routerName;
    }
  },
  methods: {
    goBack() {
      this.$router.back();
    }
  }
}
</script>

<style lang="scss" scoped>
.header-back {
  position: relative;
  height: 147px;
  .nav-header {
    position: absolute;
    top: 21px;
    left: 0;
    right: 0;
    left: 0;
    height: 40px;
    line-height: 40px;
    .back {
      float: left;
      .title {
        font-size: 16px;
        margin-left: 40px;
        color: #fff;
      }
      .icon {
        cursor: pointer;
        width: 40px;
        height: 40px;
        position: absolute;
        left: 0;
        top: 0;
        &::before {
          content: "";
          position: absolute;
          top: 12px;
          display: block;
          width: 12px;
          height: 12px;
          border-left: 2px solid #00a3ff;
          border-top: 2px solid  #00a3ff;
          @include webkit(transform, rotate(-45deg));
        }
      }
    }
    .right-wrap {
      float: right;
    }
  }

}
</style>